@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="bannerInfoForm">

            <div class="row">
                <input type="hidden" id="orgId" value="${model.orgId}">
                <input type="hidden" id="code" value="${model.code}">
                <input type="hidden" value="${uploadUrl}" id="uploadUrl">
                <input type="hidden" value="${storageUrl}" id="storageUrl">
                <div class="col-sm-12 b-r">

                    <#input id="name" name="名称" underline="true" span="true"/>
                    <#select id="type" name="类型">
                    <option value="0">图片链接</option>
                    <option value="1">文字链接</option>
                </#select>
                    <#avatar  id="avatar" name="图片"/>
                    <div class="progress progress-striped" id="progressTipArea" style="margin-top: 10px;">
                        <div id="progressBar" style="width: 0%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0"
                             role="progressbar" class="progress-bar progress-bar-info">
                        </div>
                    </div>
                    <#input id="sort" name="排序" underline="true" span="true"/>
                    <#input id="website" name="链接地址" underline="true"/>
                </div>
            </div>

            <div class="row btn-group-m-t">
                <div class="col-sm-10" style="text-align: center">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="BannerInfoDlg.addSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="BannerInfoDlg.close()"/>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="${ctxPath}/static/modular/system/xymh/banner/banner_info.js"></script>
<script>
    $(function() {
        Feng.initValidator("bannerInfoForm", BannerInfoDlg.validateFields);
        var avatarUp = new $WebUpload("avatar");
        avatarUp.setUploadBarId("progressBar");
        avatarUp.setUploadUrl($("#uploadUrl").val());
        avatarUp.init();
    });
    $("#type").change(function(e){
        if (1 == $(this).val()) {
            $("#avatarDiv").hide();
            $("#progressTipArea").hide();

        } else if (0 == $(this).val()) {
            $("#avatarDiv").show();
            $("#progressTipArea").show();
        }
    });
</script>
@}
